home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / PartMaker 4.4 / PartMaker Documents / Script Runner• / Script Runner•.rsrc / dFRK_5036 < prev    next >
Encoding:
Text File  |  1995-12-12  |  1.9 KB  |  73 lines

  1. /*------------------------------------------------------------------------------
  2.     File:        ScriptRunnerAgentInit.cpp
  3.  
  4.     Contains:    CFM Initialization routine
  5.  
  6.     Written by:    Sue Dumont
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. ------------------------------------------------------------------------------*/
  10.  
  11. // -- Compiler/Preprocessor Switches --
  12.  
  13. #ifndef _COMPILERDEFS_
  14. #include "CompDefs.h"
  15. #endif
  16.  
  17. // -- OpenDoc Utilities --
  18.  
  19. #ifndef _EXCEPT_
  20. // Exceptions define several important macros (eg. CHECKENV)
  21. // which are used in the SOM method dispatch glue. If Except.h
  22. // is not included early enough, exceptions may not be thrown
  23. // correctly when returning from a SOM method with "ev" parameter set.
  24. #include <Except.h>
  25. #endif
  26.  
  27. #ifndef _ODMEMORY_
  28. #include <ODMemory.h>
  29. #endif
  30.  
  31. #ifndef __USERSRCM__
  32. #include <UseRsrcM.h>
  33. #endif
  34.  
  35. // -- MacToolbox Includes --
  36.  
  37. #ifndef __CODEFRAGMENTS__
  38. #include <CodeFragments.h>
  39. #endif
  40.  
  41.  
  42. #ifdef applec
  43. #pragma segment ScriptRunnerAgentCFMInit
  44. #endif
  45.  
  46.  
  47. //------------------------------------------------------------------------------
  48. // Prototypes
  49. //------------------------------------------------------------------------------
  50.  
  51. extern "C" pascal OSErr ScriptRunnerAgentCFMInit(CFragInitBlockPtr initBlkPtr);
  52.  
  53. //------------------------------------------------------------------------------
  54. // OSAPlugInCFMInit Function
  55. //------------------------------------------------------------------------------
  56.  
  57. extern "C" pascal OSErr ScriptRunnerAgentCFMInit(CFragInitBlockPtr initBlkPtr)
  58. {
  59.     OSErr    err1, err2;
  60.  
  61.     // We are using OpenDoc's memory management calls, so we
  62.     // must initialize the interface to the memory manager.
  63.     err1 = InitODMemory();
  64.  
  65.     if ( !err1 )
  66.     {
  67.         // We must also capture the relevant information about
  68.         // our library file so that we may access our resources.
  69.         err2 = InitLibraryResources(initBlkPtr);
  70.     }
  71.     return (OSErr) (err1 != noErr) ? err1 : err2;
  72. }
  73.